<div class="big-text">
  <%= "Worklogs of #{@user.name} for #{@date.strftime("%d %B %Y")}" %>

</div>
<div class="export-options">
  <%= link_to "PDF", current_url(:format => :pdf), :target => "_blank" %>
  <%= link_to "CSV", current_url(:format => :csv), :target => "_blank" %>
  <%= link_to "Excel", current_url(:format => :xls), :target => "_blank" %>
</div>
<table class="table sortable-table">
  <thead>
  <tr>
    <th width="500">Task</th>
    <th width="200">Duration</th>
    <th width="500">Description</th>
    <th width="200">Actions</th>
  </tr>
  </thead>
  <% @work_logs.each do |log| %>
      <tr>
        <td><%= log.task.name %></td>
        <td><%= log.minutes.to_duration %></td>
        <td><%= log.description %></td>
        <% if @current_user.id == @user.id and log.delete_request == false and log.date < 4.days.ago%>
          <td><%= link_to 'Reqest Removal', delete_request_work_log_path(log), :method => :post, :confirm => 'Are you sure you want to request for removal of this log?' %></td>
        <%elsif @current_user.manager? and log.delete_request == true%>
          <td><%= link_to 'Delete', work_log_path(log), :method => :delete, :confirm => 'Are you sure you want to remove this log?' %> | <%= link_to 'Ignore', ignore_request_work_log_path(log), :method => :post, :confirm => 'Are you sure you want to ignore this request?' %></td>
        <%else%>
          <td>-</td>
        <%end%>
      </tr>
  <% end %>
</table>
